#include <types.h>

/*
 * 8 bit = B = byte
 */
void io_outb(uint16_t port, uint8_t value)
{
    asm volatile ("outb %1, %0" : : "dN" (port), "a" (value));
}

uint8_t io_inb(uint16_t port)
{
    uint8_t ret;
    asm volatile("inb %1, %0" : "=a" (ret) : "dN" (port));
    return ret;
}



/*
 * 16 bit = W = word
 */
uint16_t io_inw(uint16_t port)
{
    uint16_t ret;
    asm volatile ("inw %1, %0" : "=a" (ret) : "dN" (port));
    return ret;
}
	
void io_outw(uint16_t port, uint16_t value)
{
    asm volatile ("outw %1, %0" : : "dN" (port), "a" (value));	
}



/*
 * 32 bit = D = double word
 */
void io_outd(uint16_t port, uint32_t value)
{
//	asm volatile ("outd %1, %0" : : "dN" (port), "a" (value));
}


/*
 * 64 bit = L = long
 */
void io_outl(uint16_t port, uint64_t value)
{
//    asm volatile ("outl %1, %0" : : "dN" (port), "a" (value));	
}
